/**
 * Copyright (C), 2021, 中电福富信息科技有限公司
 * FileName: RegionController
 * Author:   xujiajun
 * Date:     2021/3/9 11:23
 */
package com.example.demo.web.rest.controller;

import com.example.demo.client.SmQryClient;
import com.example.demo.client.evt.cssmqry.GetRegionChildrenEvt;
import com.example.demo.client.evt.cssmqry.QryRegionListEvt;
import com.ffcs.oss.param.out.ServiceResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description:
 * @Author xujiajun
 * @Date 2021/3/9  11:23
 */
@Api("区域接口")
@RestController
@RequestMapping("/api/region")
public class RegionController {

    @Autowired
    private SmQryClient smQryClient;

    @ApiOperation("查询区域信息")
    @PostMapping("/qryRegionList")
    public ServiceResp qryRegionList(@RequestBody QryRegionListEvt evt) {
        return  smQryClient.qryRegionList(evt);
    }

    @ApiOperation("查询区域信息不转成树")
    @PostMapping("/getRegionList")
    public ServiceResp getRegionList(@RequestBody GetRegionChildrenEvt evt) {
        return  ServiceResp.getInstance().success(smQryClient.getRegionList(evt));
    }
}